package com.sky.mapper;

import com.sky.entity.DishFlavor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DishFlavorMapper {
    /**
     * 新增口味
     * @param flavors
     */
    void insertBatch(List<DishFlavor> flavors);

    /**
     * 根据菜品ID删除口味
     * @param DishId
     */
    @Delete("delete from dish_flavor where dish_id=#{DishId}")
    void deletByDishId(Long DishId);

    /**
     * 根据菜品ID批量删除口味
     * @param DishIds
     */
    void deletByDishIds(List<Long> DishIds);

    /**
     * 根据DishID查询口味
     * @param DishId
     * @return
     */
    @Select("select * from dish_flavor where dish_id=#{DishId}")
    List<DishFlavor> selectByDishId(Long DishId);

    /**
     * 修改口味
     * @param flavor
     */
    void update(DishFlavor flavor);
}
